package com.aaa.entity;

import com.aaa.vo.CarVo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 
 * @TableName crs_car
 */
@ApiModel(description = "车辆")
@TableName(value ="crs_car")
@Data
public class Car {
    /**
     * 
     */
    @ApiModelProperty("id")
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 
     */
    @ApiModelProperty("")
    @TableField(exist = false)
    private String shopName;
    @ApiModelProperty(hidden = true)
    @TableField(exist = false)
    private String typeName;
    @ApiModelProperty(hidden = true)
    @TableField(exist = false)
    private String brandName;
    @ApiModelProperty(hidden = true)
    @TableField(exist = false)
    private String configName;

    @ApiModelProperty(hidden = true)
    private String carName;

    /**
     * 类型
     */
    @ApiModelProperty("类型")
    private Integer type;

    /**
     * 
     */
    @ApiModelProperty("品牌类型")
    private Integer brandId;

    /**
     * 
     */
    @ApiModelProperty("配置id")
    private Integer configId;

    /**
     * 简介
     */
    @ApiModelProperty("简介")
    private String intro;

    /**
     * 车辆识别码
     */
    @ApiModelProperty("车辆识别码")
    private String vin;

    /**
     * 
     */
    @ApiModelProperty("")
    private Double buyPrice;

    /**
     * 门店编号
     */
    @ApiModelProperty("门店编号")
    private Integer shopId;

    /**
     * 车辆状态(可租1，维修中2，删除4)
     */
    @ApiModelProperty("车辆状态(可租1，维修中2，删除4)")
    private Integer state;

    /**
     * 价钱
     */
    @ApiModelProperty("价钱")
    private Double price;

    /**
     * 
     */
    @ApiModelProperty("添加时间")
    @DateTimeFormat(pattern ="yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date addtime;

    /**
     * 保险ID
     */
    @ApiModelProperty("保险ID")
    private Integer insuranceId;

    /**
     * 封面图片
     */
    @ApiModelProperty("封面图片")
    private String coverImg;

    @ApiModelProperty(hidden = true)
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Car other = (Car) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getCarName() == null ? other.getCarName() == null : this.getCarName().equals(other.getCarName()))
            && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
            && (this.getBrandId() == null ? other.getBrandId() == null : this.getBrandId().equals(other.getBrandId()))
            && (this.getConfigId() == null ? other.getConfigId() == null : this.getConfigId().equals(other.getConfigId()))
            && (this.getIntro() == null ? other.getIntro() == null : this.getIntro().equals(other.getIntro()))
            && (this.getVin() == null ? other.getVin() == null : this.getVin().equals(other.getVin()))
            && (this.getBuyPrice() == null ? other.getBuyPrice() == null : this.getBuyPrice().equals(other.getBuyPrice()))
            && (this.getShopId() == null ? other.getShopId() == null : this.getShopId().equals(other.getShopId()))
            && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getAddtime() == null ? other.getAddtime() == null : this.getAddtime().equals(other.getAddtime()))
            && (this.getInsuranceId() == null ? other.getInsuranceId() == null : this.getInsuranceId().equals(other.getInsuranceId()))
            && (this.getCoverImg() == null ? other.getCoverImg() == null : this.getCoverImg().equals(other.getCoverImg()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCarName() == null) ? 0 : getCarName().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getBrandId() == null) ? 0 : getBrandId().hashCode());
        result = prime * result + ((getConfigId() == null) ? 0 : getConfigId().hashCode());
        result = prime * result + ((getIntro() == null) ? 0 : getIntro().hashCode());
        result = prime * result + ((getVin() == null) ? 0 : getVin().hashCode());
        result = prime * result + ((getBuyPrice() == null) ? 0 : getBuyPrice().hashCode());
        result = prime * result + ((getShopId() == null) ? 0 : getShopId().hashCode());
        result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getAddtime() == null) ? 0 : getAddtime().hashCode());
        result = prime * result + ((getInsuranceId() == null) ? 0 : getInsuranceId().hashCode());
        result = prime * result + ((getCoverImg() == null) ? 0 : getCoverImg().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", carname=").append(carName);
        sb.append(", type=").append(type);
        sb.append(", brandId=").append(brandId);
        sb.append(", configId=").append(configId);
        sb.append(", intro=").append(intro);
        sb.append(", vin=").append(vin);
        sb.append(", buyPrice=").append(buyPrice);
        sb.append(", shopId=").append(shopId);
        sb.append(", state=").append(state);
        sb.append(", price=").append(price);
        sb.append(", addtime=").append(addtime);
        sb.append(", insuranceId=").append(insuranceId);
        sb.append(", coverImg=").append(coverImg);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }


}